home *** CD-ROM | disk | FTP | other *** search
/ Computer Inter@ctive 17 / Computer Interactive cdrom 17 - gen 99.iso / ZDNETIT / CONTENT / OPTIVC16.ZIP / DOC.ZIP / MATRIX.TXT < prev    next >
Encoding:
Text File  |  1998-10-21  |  46.5 KB  |  916 lines

  1.        OOOOOO                            VV        VV
  2.       OO    OO   PPPPPPP   TTTTTTTT  II   VV      VV  EEEEEE   CCCCCC
  3.       OO    OO   PP    PP     TT     II    VV    VV   EE       CC
  4.       OO    OO   PPPPPPP      TT     II     VV   VV   EEEEEE   CC
  5.       OO    OO   PP           TT     II       VVV     EE       CC
  6.        OOOOOO    PP           TT     II        V      EEEEEE   CCCCCC
  7.  
  8.  
  9.                        OptiVec  Version 1.2
  10.                          for Borland C++
  11.                      (Version 3.0 or higher)
  12.  
  13.               Part Three: Description of MatrixLib
  14.  
  15.                      Dr. Martin Sander Software Development
  16.                      Sertürnerstr. 11
  17.                      D-37085 Göttingen
  18.                      Germany
  19.                      e-mail: MartinSander@Bigfoot.com
  20.                      http://www.optivec.com
  21.  
  22. ****************************************************************************
  23.  
  24. !!     This is an ASCII text file!  It is best viewed with a simple        !!
  25. !!     DOS editor.                                                         !!
  26. !!     If you load this file into a word processor under Windows, you      !!
  27. !!     must use the filter "DOS text".                                     !!
  28. !!     Alternatively, you may use FCONVERT (shipped with Borland C++) to   !!
  29. !!     convert from ASCII (OEM) into the ANSI character set.               !!
  30. !!     Preferrably use the lettertype CourierNew 10 pt.                    !!
  31.  
  32. A general description of OptiVec is given in the  F i r s t  P a r t
  33. of this documentation, in the file HANDBOOK.TXT.
  34. Chapter 1.2 of that file contains the licence terms.
  35. See FUNCREF.TXT for the description of VectorLib functions,
  36. and CMATH.TXT for CMATH functions.
  37.  
  38. Copyright for the Software and its documentation (C) 1996-1998 Martin Sander
  39.  
  40.  
  41. ****************************************************************************
  42. *                                                                          *
  43. *******                           Contents                           *******
  44. *                                                                          *
  45. ****************************************************************************
  46.  
  47.  1. MatrixLib Introduction
  48.  2. Management of Dynamically Generated Matrices
  49.  3. Initialization of Matrices
  50.  4. Data-Type Conversions
  51.  5. Transposing and Extracting Parts from a Matrix
  52.  6. Arithmetic Operations Performed on a Single Row, Column, or the Diagonal
  53.  7. Operations performed along all rows or all columns simultaneously
  54.  8. Operations involving two rows or two colums
  55.  9. Matrix Multiplication
  56. 10. Linear Algebra 
  57. 11. Eigenvalues and Eigenvectors
  58. 12. Two-Dimensional Fourier-Transform Methods
  59. 13. Data Fitting
  60. 14. Matrix Input and Output
  61. 15. Graphical Representation of Matrices
  62. 16. Alphabetical Syntax Reference
  63.  
  64.  
  65. 1. MatrixLib Introduction
  66. -------------------------
  67.  
  68. MatrixLib defines the following data types:
  69.   fMatrix   matrix of floats
  70.   dMatrix   matrix of doubles
  71.   eMatrix   matrix of extended (long double)
  72.   cfMatrix  matrix of fComplex (complex<float>)
  73.   cdMatrix  matrix of dComplex (complex<double>)
  74.   ceMatrix  matrix of eComplex (complex<extended>)
  75.  
  76. The ordering of elements is the same as in the two-dimensional arrays
  77. provided by the respective target compilers. This means that the matrices
  78. are stored row-wise in MatrixLib versions for C and C++ compilers, but
  79. column-wise in versions for Pascal and Fortran.
  80. At present, integer matrices are defined, but no functions are available
  81. for them.
  82.  
  83. While we recommend to exclusively use these dynamically allocated matrix
  84. types, static matrices defined, e.g., as
  85.     float  MX[4][6];
  86. can be used in all MatrixLib functions with the exception of the multiLinfit
  87. and multiNonlinfit routines.
  88.  
  89. Each MatrixLib function has a prefix defining the data type on which it acts:
  90.  
  91. MF_  for arguments of the types fMatrix, float and fVector
  92. MD_  for arguments of the types dMatrix, double and dVector
  93. ME_  for arguments of the types eMatrix, extended (long double) and eVector
  94. MCF_ for arguments of the types cfMatrix, fComplex and cfVector
  95. MCD_ for arguments of the types cdMatrix, dComplex and cdVector
  96. MCE_ for arguments of the types ceMatrix, eComplex and ceVector
  97.  
  98.  
  99. 2. Management of Dynamically Generated Matrices
  100. -----------------------------------------------
  101.  
  102. MF_matrix      allocate memory for a matrix
  103. MF_matrix0     allocate memory and set all elements 0
  104. M_free         free one matrix (data-type independent)
  105. M_nfree        free n matrices (data-type independent)
  106. V_freeAll      free all existing vectors and matrices 
  107.  
  108. OptiVec's dynamically allocated matrices can be addressed just like two-
  109. dimensional static arrays of C. If you have, e.g., an fMatrix MX and
  110. a variable float a, you can write a line like
  111.      a = MX[3][5];
  112.  
  113. Additionally, there are two functions addressing single elements
  114. (which are necessary for Pascal and for getting around the
  115. pointer arithmetics bug in some versions of Borland C++):
  116.  
  117. MF_Pelement    Pointer to a specific matrix element
  118. MF_element     value of a specific matrix element
  119.  
  120.  
  121. 3. Initialization of Matrices
  122. -----------------------------
  123.  
  124. MF_equ0        set all elements to 0
  125. MF_equ1        identity matrix: set all diagonal elements to 1.0,
  126.                all others to 0
  127. MF_outerprod   matrix formed by the "outer product" of two vectors
  128.  
  129. MF_Row_equC    set all elements of one specific row to the constant C
  130. MF_Col_equC    set all elements of one specific column to the constant C
  131. MF_Dia_equC    set all diagonal elements to the constant C
  132. MF_Row_equV    copy a vector into one specific row
  133. MF_Col_equV    copy a vector into one specific column
  134. MF_Dia_equV    copy a vector into the diagonal
  135.  
  136. MF_equM        make one matrix the copy of another
  137. MF_UequL       copy lower-diagonal elements into upper-diagonal
  138.                by index-reflection, so as to get a symmetric matrix 
  139. MF_LequU       copy upper-diagonal elements into lower-diagonal
  140.  
  141. Two-dimensional windows for spectral analysis are provided by:
  142. MF_Hanning     Hanning window
  143. MF_Parzen      Parzen window
  144. MF_Welch       Welch window
  145.  
  146.  
  147. 4. Data-Type Conversions
  148. ------------------------
  149.  
  150. Matrices of every data type can be converted into every other.
  151. Only a few examples are given; the rest should be obvious.
  152.  
  153. M_FtoD    fMatrix to dMatrix
  154. M_CDtoCF  cdMatrix to cfMatrix (with overflow protection)
  155. M_DtoE    dMatrix to eMatrix
  156.  
  157.  
  158. 5. Transposing and Extracting Parts from a Matrix
  159. -------------------------------------------------
  160.  
  161. MF_transpose        transpose a matrix
  162.  
  163. MF_submatrix        extract a submatrix
  164. MF_submatrix_equM   copy a submatrix back into another (normally larger)
  165.                     matrix
  166.  
  167. MF_Row_extract      extract a single row and copy it into a vector
  168. MF_Col_extract      extract a single column and copy it into a vector
  169. MF_Dia_extract      extract the diagonal and copy it into a vector
  170.  
  171. 6. Arithmetic Operations Performed on a Single Row, Column, or the Diagonal
  172. ---------------------------------------------------------------------------
  173.  
  174. MF_Row_addC         add a constant to all elements of a specific row
  175. MF_Col_addC         add a constant to all elements of a specific column
  176. MF_Dia_addC         add a constant to all diagonal elements
  177. MF_Row_addV         add corresponding vector elements to all elements of a
  178.                     specific row
  179. MF_Col_addV         add corresponding vector elements to all elements of a
  180.                     specific column
  181. MF_Dia_addV         add corresponding vector elements to the diagonal elements
  182.  
  183. A few examples should suffice for the other functions of this family:
  184. MF_Row_subC         subtract a constant from all elements of a specific row
  185. MF_Col_subrC        reverse substraction: difference between column elements
  186.                     and a constant
  187. MF_Dia_mulV         multiply the diagonal elements with corresponding vector
  188.                     elements
  189. MF_Row_divV         divide all elements of a specific row by corresponding
  190.                     vector elements
  191. MF_Col_divrC        reverse division: division of a constant by the individual
  192.                     column elements
  193.  
  194.  
  195. 7. Operations performed along all rows or all columns simultaneously,
  196.          or along the diagonal of a square matrix
  197. ----------------------------------------------------------------------
  198.  
  199. MF_Rows_max         store the maxima of all rows in a column vector
  200. MF_Cols_max         store the maxima of all colums in a row vector
  201. MF_Dia_max          return the maximum of the diagonal as a scalar
  202.  
  203. MF_Rows_min         store the minima of all rows in a column vector
  204. MF_Cols_min         store the minima of all colums in a row vector
  205. MF_Dia_min          return the minimum of the diagonal as a scalar
  206.  
  207. MF_Rows_absmax      store the absolute maxima of all rows in a column vector
  208. MF_Cols_absmax      store the absolute maxima of all colums in a row vector
  209. MF_Dia_absmax       return the absolute maximum of the diagonal as a scalar
  210. MF_Rows_absmin      store the absolute minima of all rows in a column vector
  211. MF_Cols_absmin      store the absolute minima of all colums in a row vector
  212. MF_Dia_absmin       return the absolute minimum of the diagonal as a scalar
  213.  
  214. MF_Rows_sum         sum, taken along rows and stored in a column vector
  215. MF_Cols_sum         sum, taken along colums and stored in a row vector
  216. MF_Dia_sum          sum of the diagonal elements
  217.  
  218. MF_Rows_prod        product, taken along rows and stored in a column vector
  219. MF_Cols_prod        product, taken along colums and stored in a row vector
  220. MF_Dia_prod         product of the diagonal elements
  221.  
  222. MF_Rows_runsum      running sum along rows
  223. MF_Cols_runsum      running sum along columns
  224. MF_Rows_runprod     running product along rows
  225. MF_Cols_runprod     running product along columns
  226.  
  227. MF_Rows_rotate      rotate all rows by a specified number of positions
  228. MF_Cols_rotate      rotate all rows by a specified number of positions
  229. MF_Rows_reflect     set the upper halves of all rows equal to their reversed
  230.                     lower halves
  231. MF_Cols_reflect     set the upper halves of all columns equal to their
  232.                     reversed lower halves
  233.  
  234.  
  235. 8. Operations involving two rows or two colums
  236. ----------------------------------------------
  237.  
  238. MF_Rows_exchange   exchange two rows
  239. MF_Cols_exchange   exchange two columns
  240.  
  241. MF_Rows_add        add two rows  (destination += source)
  242. MF_Cols_add        add two columns 
  243.  
  244. MF_Rows_sub        subtract two rows (destination -= source)
  245. MF_Cols_sub        subtract two columns
  246.  
  247. MF_Rows_Cadd       add scaled row to another (destination += C * source)
  248. MF_Cols_Cadd       add scaled column to another
  249.  
  250. MF_Rows_lincomb    linear combination of two rows
  251. MF_Cols_lincomb    linear combination of two columns
  252.  
  253.  
  254. 9. Matrix Multiplication
  255. ------------------------
  256.  
  257. MF_mulV            multiply a matrix by a column vector
  258. VF_mulM            multiply a row vector by a matrix
  259. MF_mulM            multiply two matrices
  260.  
  261. 10. Linear Algebra
  262. ------------------
  263.  
  264. First the "easy-to-use" versions of linear algebra functions:
  265. MF_solve          solve simultaneous linear equations, using LU decomposition
  266. MF_inv            invert a matrix
  267. MF_det            determinant of a matrix
  268. MF_solveBySVD     solve simultaneous linear equations, using Singular Value
  269.                   Decomposition
  270. MF_safeSolve      try first solution by LUD; if that fails, SVD is done.
  271.  
  272. Now some functions for LU decomposition and for treatment of
  273. LU decomposed matrices:
  274.  
  275. MF_LUdecompose    decompose into LU form
  276. MF_LUimprove      improve accuracy of LU decomposition by iteration
  277. MF_LUDresult      check if MF_LUdecompose was successful
  278. MF_LUDsetEdit     set editing threshold for MF_LUdecompose; may be used to
  279.                   work around singularities
  280. MF_LUDgetEdit     retrieve currently set threshold
  281.  
  282. MF_LUsolve        solve simultaneous linear equations, given the matrix in
  283.                   LU form
  284. MF_LUinv          invert matrix already composed into LU form
  285. MF_LUdet          determinant of matrix already composed into LU form
  286.  
  287. Singular Value Decomposition and related functions:
  288.  
  289. MF_SVdecompose    Singular Value Decomposition
  290. MF_SVsolve        solve SV-decomposed set of linear equations
  291. MF_SVimprove      iterative improvement of solution found by MF_SVsolve
  292. MF_SVDsetEdit     set threshold for Singular Value editing
  293. MF_SVDgetEdit     retrieve current threshold for Singular Value editing
  294.  
  295.  
  296. 11. Eigenvalues and Eigenvectors
  297. --------------------------------
  298.  
  299. MFsym_eigenvalues  eigenvalues with or without eigenvectors of a symmetric
  300.                    real matrix (only this special, but most frequent case
  301.                    is currently covered)
  302.  
  303. 12. Two-Dimensional Fourier-Transform Methods
  304. ---------------------------------------------
  305.  
  306. MF_FFT            Fast Fourier Transform
  307. MF_convolve       Convolution with a spacial response function
  308. MF_deconvolve     Deconvolution
  309. MF_filter         Spatial filtering
  310. MF_autocorr       Spatial autocorrelation
  311. MF_xcorr          Spatial cross-correlation
  312. MF_spectrum       Spatial frequency spectrum
  313.  
  314.  
  315. 13. Data Fitting
  316. ----------------
  317.  
  318. The functions for fitting X-Y pairs of data are included in MatrixLib
  319. rather than in VectorLib, because they heavily rely on matrix methods.
  320. Their prefix, VF_, however, is a reminder that they actually work on
  321. vectors, rather than on matrices. (The weighted variants actually do
  322. also work on a matrix and calculate the covariance matrix of parameters).
  323. The simplest form of data fitting, namely linear regression, does not
  324. employ matrix methods and is described in the VectorLib documentation:
  325. VF_linregress.
  326.  
  327. VF_polyfit        fit an X-Y data pair to a polynomial of arbitrary degree
  328. VF_polyfitwW      the same with non-equal weighting of individual data points
  329. VF_linfit         fit an X-Y data pair to a function linear in its parameters
  330. VF_linfitwW       the same with non-equal weighting of individual data points
  331. VF_nonlinfit      fit X-Y data to an arbitrary, possibly non-linear function
  332. VF_nonlinfitwW    the same for non-equal data-point weighting
  333. VF_multiLinfit       fit multiple X-Y data sets to one common model,
  334.                      linear in its parameters
  335. VF_multiLinfitwW     the same for non-equal data-point weighting
  336. VF_multiNonlinfit    fit multiple X-Y data sets to one common model,
  337.                      possibly nonlinear in its parameters
  338. VF_multiNonlinfitwW  the same for non-equal data-point weighting
  339.  
  340. With the exception of fitting to polynoms, which are present only for the
  341. X-Y data case, here are the corresponding functions for fitting
  342. z = f(x,y) data (with the prefix MF_):
  343.  
  344. MF_linfit         fit X-Y-Z data to a function linear in its parameters
  345. MF_linfitwW       the same with non-equal weighting of individual data points
  346.  
  347. MF_nonlinfit      fit X-Y-Z data to an arbitrary, possibly non-linear function
  348. MF_nonlinfitwW    the same for non-equal data-point weighting
  349.  
  350. MF_multiLinfit       fit multiple X-Y-Z data sets to one common model,
  351.                      linear in its parameters
  352. MF_multiLinfitwW     the same for non-equal data-point weighting
  353. MF_multiNonlinfit    fit multiple X-Y-Z data sets to one common model,
  354.                      possibly nonlinear in its parameters
  355. MF_multiNonlinfitwW  the same for non-equal data-point weighting
  356.  
  357. The nonlinear fitting routines are highly sophisticated and offer the user
  358. a lot of different options. These options may be set by the function
  359. V_setNonlinfitOptions. To retrieve current settings, use
  360. V_getNonlinfitOptions.
  361.  
  362. All options are packed into a structure named VF_NONLINFITOPTIONS.
  363. VF_NONLINFITOPTIONS has the following fields:
  364.  
  365. int      FigureOfMerit       0: least squares fitting
  366.                              1: robust fitting, optimizing for minimum
  367.                                 absolute deviation
  368.                              Default: 0
  369.  
  370. float    AbsTolChi           absolute change of chi (default: EPSILON)
  371. float    FracTolChi          fractional change of chi
  372.                                     (default: SQRT_EPSILON)
  373. float    AbsTolPar           absolute change of all parameters
  374.                                     (default: SQRT_MIN) 
  375. float    FracTolPar          fractional change of all parameters
  376.                                     (default: SQRT_EPSILON)
  377.                              These four parameters describe the convergence
  378.                              conditions: if the changes achieved in successive
  379.                              iterations are smaller than demanded by these
  380.                              criteria, this signals convergence. Set those
  381.                              criteria to 0.0, which are not applicable
  382.  
  383. unsigned HowOftenFulfill     how often fulfill one of the above conditions
  384.                              before convergence is considered achieved
  385.                              (default: 3)
  386.  
  387. unsigned LevelOfMethod       1: Levenberg-Marquardt method,
  388.                              2: Downhill Simplex (Nelder and Mead) method,
  389.                              3: both methods alternating;
  390.                                 add 4 to this in order to try
  391.                                 breaking out of local minima;
  392.                              0: no fit, calculate only chi2 (and Covar)
  393.                              (default: 1)
  394.  
  395. unsigned LevMarIterations    max.number of successful iterations of LevMar
  396.                              during one run (default: 100)
  397.  
  398. unsigned LevMarStarts        number of LevMar restarts per run (default: 2)
  399.  
  400. float    LambdaStart,
  401.          LambdaMin,
  402.          LambdaMax,
  403.          LambdaDiv,
  404.          LambdaMul           treatment of LevMar parameter lambda (don't
  405.                              touch, unless you are an expert!)
  406.  
  407. unsigned DownhillIterations  max. number of successful iterations in Downhill
  408.                              Simplex method  (default: 200)
  409.  
  410. float    DownhillReflection,
  411.          DownhillContraction,
  412.          DownhillExpansion   treatment of re-shaping of the simplex in
  413.                              Downhill Simplex method  (don't touch
  414.                              unless you are an expert!)
  415.  
  416. unsigned TotalStarts;        max. number of LevMar/Downhill pairs
  417.                              (default: 16)
  418.  
  419. fVector  UpperLimits;        impose upper limits on parameters. Default: NULL
  420. fVector  LowerLimits         impose lower limits on parameters. Default: NULL
  421.  
  422. void     (*Restrictions)(void);  user-defined function, implementing
  423.                              restrictions on the parameters which are not
  424.                              contained in the upper/lower limits restriction.
  425.                              The function must check the whole parameter
  426.                              vector and edit the parameters as needed.
  427.                              Default: NULL 
  428.  
  429.  
  430. The multifit functions, i.e. those which allow the treatment of several
  431. X-Y or X-Y-Z data sets simultaneously, need the data to be passed in
  432. structures named VF_EXPERIMENT for X-Y data and MF_EXPERIMENT for X-Y-Z
  433. data:
  434.  
  435. VF_EXPERIMENT has the following fields:
  436.  
  437. fVector X, Y               X and Y vectors
  438. fVector InvVar             inverse variances of the individual vector
  439.                            elements (needed only for the "with weights"
  440.                            functions)
  441. ui      size               the number of vector elements 
  442. float   WeightOfExperiment individual weight to be assigned to the
  443.                            whole experiment (again needed only for
  444.                            the weighted variants)
  445.  
  446. MF_EXPERIMENT has the following fields:
  447.  
  448. fVector   X, Y             X and Y vectors (independent variables)
  449. fMatrix   MZ               measured data z=f(x,y)
  450. fMatrix   MInvVar          inverse variances of the individual matrix
  451.                            elements (needed only for the "with weights"
  452.                            functions)
  453. unsigned  htZ, lenZ        matrix dimensions
  454. float     WeightOfExperiment weight to be assigned to the whole
  455.                            experiment (again needed only for
  456.                            the weighted variants)
  457.  
  458.  
  459. 14. Matrix Input and Output
  460. ---------------------------
  461.  
  462. The matrix input/output functions are all analogous to the corresponding
  463. vector functions
  464.  
  465. MF_cprint   print a matrix to the screen. If necessary, rows are cut off
  466.             at the screen boundaries. If there are more rows than screen
  467.             lines, proper paging is applied.
  468. MF_print    print a matrix to the screen (without paging or row cut-off)
  469. MF_fprint   print a matrix in ASCII format to a stream. 
  470.  
  471. MF_store    store in binary format
  472. MF_recall   retrieve in binary format
  473. MF_write    write in ASCII format in a stream
  474. MF_read     read from an ASCII file.
  475.  
  476.  
  477. 15. Graphical Representation of Matrices
  478. ----------------------------------------
  479.  
  480. True 3D-plotting functions will be included only in future versions.
  481. For now, only color-density plots are available. In these plots, each
  482. data value is translated into a color value by linear interpolatiion
  483. between two colors, specified as mincolor and maxcolor.
  484.  
  485. MF_xyzAutoDensityMap    Color density map for z=f(x,y) with automatic
  486.                         scaling of the X and Y axes and of the color
  487.                         density scale between mincolor and maxcolor.
  488. MF_xyzDataDensityMap    z=f(x,y) color density map, plotted into an
  489.                         existing axis frame, and using the color density
  490.                         scale set by the last call to an "AutoDensityMap"
  491.                         function.
  492. MF_zAutoDensityMap      Color density map for z=f(i,j) with automatic
  493.                         scaling of the X and Y axes and of the color
  494.                         density scale between mincolor and maxcolor.
  495.                         i and j are the indices in X and Y direction,
  496.                         respectively.
  497. MF_zDataDensityMap      Color density map for z=f(i,j), plotted into
  498.                         an existing axis frame, and using the color
  499.                         density scale set by the last call to an
  500.                         "AutoDensityMap" function.
  501.  
  502.  
  503. 16. Alphabetical Syntax Reference
  504. ---------------------------------
  505.  
  506. This chapter summarizes, in alphabetical order, the syntax of MatrixLib
  507. functions. As usual, the MF_ or M_ prefix is neglected in the ordering
  508. of entries. The particles "Row_", "Rows_", "Col_", "Cols_", and "Dia_",
  509. however, are fully counted. For example, MF_Rows_ functions will come
  510. after all MF_Row_ functions. While most MatrixLib functions have the
  511. prefixes MF_ or M_, please note that some functions have the prefix VF_.
  512. These functions have been included into MatrixLib, because they use
  513. matrix methods. Their prefix is a reminder, however, that their functional
  514. behaviour is aimed at vectors more than on matrices, as in VF_linfit and
  515. other fitting functions. 
  516.  
  517. void    MF_autocorr( fPMatrix MACorr, fPMatrix MX,
  518.                      unsigned ht, unsigned len );
  519. void    M_CDtoCE( ceMatrix MF, cdMatrix MD, unsigned ht, unsigned len );
  520. void    M_CDtoCF( cfMatrix MF, cdMatrix MD, unsigned ht, unsigned len );
  521. void    M_CEtoCD( cdMatrix MF, ceMatrix MD, unsigned ht, unsigned len );
  522. void    M_CEtoCF( cfMatrix MF, ceMatrix MD, unsigned ht, unsigned len );
  523. void    M_CFtoCD( cdMatrix MF, cfMatrix MD, unsigned ht, unsigned len );
  524. void    M_CFtoCE( ceMatrix MF, cfMatrix MD, unsigned ht, unsigned len );
  525. void    MF_Col_addC( fMatrix MA, unsigned ht, unsigned len,
  526.                          unsigned iCol, float C );
  527. void    MF_Col_addV( fMatrix MA, unsigned ht, unsigned len,
  528.                          unsigned iCol, fVector X );
  529. void    MF_Col_divC( fMatrix MA, unsigned ht, unsigned len,
  530.                          unsigned iCol, float C );
  531. void    MF_Col_divrC( fMatrix MA, unsigned ht, unsigned len,
  532.                          unsigned iCol, float C );
  533. void    MF_Col_divrV( fMatrix MA, unsigned ht, unsigned len,
  534.                          unsigned iCol, fVector X );
  535. void    MF_Col_divV( fMatrix MA, unsigned ht, unsigned len,
  536.                          unsigned iCol, fVector X );
  537. void    MF_Col_equC( fMatrix MA, unsigned ht, unsigned len,
  538.                      unsigned iCol, float C );
  539. void    MF_Col_equV( fMatrix MA, unsigned ht, unsigned len,
  540.                      unsigned iCol, fVector X );
  541. void    MF_Col_extract( fVector Y, fMatrix MA, unsigned ht, unsigned len,
  542.                         unsigned iCol );
  543. void    MF_Col_mulC( fMatrix MA, unsigned ht, unsigned len,
  544.                          unsigned iCol, float C );
  545. void    MF_Col_mulV( fMatrix MA, unsigned ht, unsigned len,
  546.                          unsigned iCol, fVector X );
  547. void    MF_Col_subC( fMatrix MA, unsigned ht, unsigned len,
  548.                          unsigned iCol, float C );
  549. void    MF_Col_subrC( fMatrix MA, unsigned ht, unsigned len,
  550.                          unsigned iCol, float C );
  551. void    MF_Col_subV( fMatrix MA, unsigned ht, unsigned len,
  552.                          unsigned iCol, fVector X );
  553. void    MF_Col_subrV( fMatrix MA, unsigned ht, unsigned len,
  554.                          unsigned iCol, fVector X );
  555. void    MF_Cols_absmax( fVector Y, fPMatrix MA, unsigned ht, unsigned len );
  556. void    MF_Cols_absmin( fVector Y, fPMatrix MA, unsigned ht, unsigned len );
  557. void    MF_Cols_add( fPMatrix MA, unsigned ht, unsigned len,
  558.                      unsigned destCol, unsigned sourceCol );
  559. void    MF_Cols_Cadd( fPMatrix MA, unsigned ht, unsigned len,
  560.                       unsigned destCol, unsigned sourceCol, float C );
  561. void    MF_Cols_exchange( fPMatrix MA, unsigned ht, unsigned len,
  562.                           unsigned i1, unsigned i2 );
  563. void    MF_Cols_lincomb( fPMatrix MA, unsigned ht, unsigned len,
  564.                          unsigned destCol,  float  destC,
  565.                          unsigned srceCol,  float  srceC );
  566. void    MF_Cols_max( fVector Y, fPMatrix MA, unsigned ht, unsigned len );
  567. void    MF_Cols_min( fVector Y, fPMatrix MA, unsigned ht, unsigned len );
  568. void    MF_Cols_prod(fVector Y, fPMatrix MA, unsigned ht, unsigned len );
  569. void    MF_Cols_reflect( fPMatrix MA, unsigned ht, unsigned len );
  570. void    MF_Cols_rotate( fPMatrix MA, unsigned ht, unsigned len, int pos );
  571. void    MF_Cols_runprod( fPMatrix MA, unsigned ht, unsigned len );
  572. void    MF_Cols_runsum( fPMatrix MA, unsigned ht, unsigned len );
  573. void    MF_Cols_sub( fPMatrix MA, unsigned ht, unsigned len,
  574.                      unsigned destCol, unsigned sourceCol );
  575. void    MF_Cols_sum( fVector Y, fPMatrix MA, unsigned ht, unsigned len );
  576. void    MF_convolve( fPMatrix MY, fPMatrix MFlt, fPMatrix MX,
  577.                      fPMatrix MRsp, unsigned ht, unsigned len );
  578. void    MF_cprint( fPMatrix MA, unsigned ht, unsigned len );
  579. void    MF_deconvolve( fPMatrix MY, fPMatrix MFlt, fPMatrix MX,
  580.                        fPMatrix MRsp, unsigned ht, unsigned len );
  581. float   MF_det( fPMatrix MA, unsigned len );
  582. float   MF_Dia_absmax(  fPMatrix MA, unsigned len );
  583. float   MF_Dia_absmin(  fPMatrix MA, unsigned len );
  584. void    MF_Dia_addC( fMatrix MA, unsigned len, float C );
  585. void    MF_Dia_addV( fMatrix MA, unsigned len, fVector X );
  586. void    MF_Dia_divC( fMatrix MA, unsigned len, float C );
  587. void    MF_Dia_divrC( fMatrix MA, unsigned len, float C );
  588. void    MF_Dia_divrV( fMatrix MA, unsigned len, fVector X );
  589. void    MF_Dia_divV( fMatrix MA, unsigned len, fVector X );
  590. void    MF_Dia_equC( fMatrix MA, unsigned len, float C );
  591. void    MF_Dia_equV( fMatrix MA, unsigned len, fVector X );
  592. void    MF_Dia_extract( fVector Y, fMatrix MA, unsigned len );
  593. float   MF_Dia_max(  fPMatrix MA, unsigned len );
  594. float   MF_Dia_min(  fPMatrix MA, unsigned len );
  595. void    MF_Dia_mulC( fMatrix MA, unsigned len, float C );
  596. void    MF_Dia_mulV( fMatrix MA, unsigned len, fVector X );
  597. float   MF_Dia_prod( fPMatrix MA, unsigned len );
  598. void    MF_Dia_subrC( fMatrix MA, unsigned len, float C );
  599. void    MF_Dia_subrV( fMatrix MA, unsigned len, fVector X );
  600. void    MF_Dia_subC( fMatrix MA, unsigned len, float C );
  601. void    MF_Dia_subV( fMatrix MA, unsigned len, fVector X );
  602. float   MF_Dia_sum(  fPMatrix MA, unsigned len );
  603. void    M_DtoE( eMatrix MF, dMatrix MD, unsigned ht, unsigned len );
  604. void    M_DtoF( fMatrix MF, dMatrix MD, unsigned ht, unsigned len );
  605.  
  606. float   MF_element( fMatrix X, unsigned ht, unsigned len,
  607.                     unsigned m, unsigned n );
  608. void    MFsym_eigenvalues( fVector EigV, fPMatrix EigM, fPMatrix MA,
  609.                            unsigned len, int CalcEigenVec );
  610. void    MF_equ0( fMatrix MA, unsigned ht, unsigned len );
  611. void    MF_equ1( fMatrix MA, unsigned len );  /* identity matrix */
  612. void    MF_equM( fMatrix MB, fMatrix MA, unsigned ht, unsigned len );
  613. void    M_EtoD( dMatrix MF, eMatrix MD, unsigned ht, unsigned len );
  614. void    M_EtoF( fMatrix MF, eMatrix MD, unsigned ht, unsigned len );
  615. void    MF_filter( fPMatrix MY, fPMatrix MX, fPMatrix MFlt,
  616.                    unsigned ht, unsigned len );
  617. void    MF_FFT( fPMatrix MY, fPMatrix MX,
  618.                  unsigned ht, unsigned len, int dir );
  619. void    M_findDensityMapBounds( extended xmin, extended xmax,
  620.                                 extended ymin, extended ymax,
  621.                                 extended zmin, extended zmax,
  622.                                 COLORREF mincolor, COLORREF maxcolor );
  623. void    MF_fprint( FILE  *stream, fPMatrix MA, unsigned ht,
  624.                      unsigned len, unsigned linewidth );
  625. void    M_free( void **M );
  626. void    M_FtoD( dMatrix MF, fMatrix MD, unsigned ht, unsigned len );
  627. void    M_FtoE( eMatrix MF, fMatrix MD, unsigned ht, unsigned len );
  628. float   VF_getLinfitNeglect( void );
  629. void    VF_getNonlinfitOptions( VF_NONLINFITOPTIONS *Options );
  630. void    MF_Hanning( fMatrix MA, unsigned ht, unsigned len );
  631. int     MF_inv( fPMatrix MInv, fPMatrix MA, unsigned len );
  632. void    MF_LequU( fMatrix MA, unsigned len );
  633. void    VF_linfit( fVector A, iVector AStatus, unsigned npars,
  634.                    fVector X, fVector Y, ui sizex,
  635.                    void (*funcs)(fVector BasFuncs, float x, unsigned nfuncs));
  636. void    VF_linfitwW( fVector A, fPMatrix Covar, iVector AStatus,
  637.                  unsigned npars,
  638.                  fVector X, fVector Y, fVector InvVar, ui sizex,
  639.                  void (*funcs)(fVector BasFuncs, float x, unsigned nfuncs));
  640. void    MF_linfit( fVector A, iVector AStatus, unsigned npars,
  641.                fVector X, fVector Y, fPMatrix MZ, unsigned htZ, unsigned lenZ,
  642.                void (*funcs)(fVector BasFuncs, float x, float y,
  643.                              unsigned nfuncs));
  644. void    MF_linfitwW( fVector A, fPMatrix Covar, iVector AStatus,
  645.                      unsigned npars,
  646.                      fVector X, fVector Y, fPMatrix MZ, fPMatrix MInvVar,
  647.                      unsigned htZ, unsigned lenZ,
  648.                      void (*funcs)(fVector BasFuncs, float x, float y,
  649.                                    unsigned nfuncs));
  650. int     MF_LUdecompose( fPMatrix MLU,  uiVector Ind, fPMatrix MA,
  651.                             unsigned len );
  652. float   MF_LUdet( fPMatrix MLU, unsigned len, int permut );
  653. float   MF_LUDgetEdit( void );
  654. void    MF_LUDsetEdit( float Thresh );
  655.      /*  Editing threshold for MF_LUdecompose; used to cure singularities */
  656. int     MF_LUDresult( void ); /* returns 0, if MF_LUdecompose was successful;
  657.                   returns 1, if MA was (nearly) singular in MF_LUdecompose. */
  658. void    MF_LUinv( fPMatrix MInv, fPMatrix MLU, uiVector Ind,
  659.                       unsigned len );
  660. void    MF_LUsolve( fVector X, fPMatrix MLU, fVector B, uiVector Ind,
  661.                         unsigned len );
  662. void    MF_LUimprove( fVector X, fVector B, fPMatrix MA, fPMatrix MLU,
  663.                           uiVector Ind, unsigned len );
  664. fMatrix MF_matrix( unsigned ht, unsigned len );
  665. fMatrix MF_matrix0( unsigned ht, unsigned len );
  666. void    MF_mulM( fPMatrix MC, fPMatrix MA, fPMatrix MB,
  667.                     unsigned htA, unsigned lenA, unsigned lenB );
  668. void    VF_mulM( fVector Y, fVector X, fPMatrix MA,
  669.                     unsigned sizX, unsigned lenA );
  670. void    MF_mulV( fVector Y, fPMatrix MA, fVector X,
  671.                     unsigned htA, unsigned lenA );
  672. void    MF_multiLinfit( fVector A, iVector AStatus, unsigned npars,
  673.                 MF_EXPERIMENT *ListOfExperiments, unsigned nexperiments,
  674.                 void (*funcs)(fVector BasFuncs, float x, float y,
  675.                               unsigned nfuncs, unsigned iexperiment) );
  676. void    VF_multiLinfit( fVector A, iVector AStatus, unsigned npars,
  677.                 VF_EXPERIMENT *ListOfExperiments, unsigned nexperiments,
  678.                 void (*funcs)(fVector BasFuncs, float x,
  679.                               unsigned nfuncs, unsigned iexperiment) );
  680. void    MF_multiLinfitwW( fVector A, fPMatrix Covar,
  681.                 iVector AStatus, unsigned npars,
  682.                 MF_EXPERIMENT *ListOfExperiments, unsigned nexperiments,
  683.                 void (*funcs)(fVector BasFuncs, float x, float y,
  684.                               unsigned nfuncs, unsigned nexperiment) );
  685. void    VF_multiLinfitwW( fVector A, fPMatrix Covar,
  686.                 iVector AStatus, unsigned npars,
  687.                 VF_EXPERIMENT *ListOfExperiments, unsigned nexperiments,
  688.                 void (*funcs)(fVector BasFuncs, float x,
  689.                               unsigned nfuncs, unsigned nexperiment) );
  690. float   MF_multiNonlinfit( fVector A, iVector AStatus, unsigned npars,
  691.                MF_EXPERIMENT _VFAR *ListOfExperiments, unsigned nexperiments,
  692.                void (*modelfunc)(fMatrix MZModel, unsigned htZ, unsigned lenZ,
  693.                                  fVector X, fVector Y, unsigned iexperiment),
  694.                void (*derivatives)(fMatrix dZdAi, unsigned htZ, unsigned lenZ,
  695.                                    fVector X, fVector Y, unsigned ipar,
  696.                                    unsigned iexperiment) );
  697. float   VF_multiNonlinfit( fVector A, iVector AStatus, unsigned npars,
  698.                VF_EXPERIMENT _VFAR *ListOfExperiments, unsigned nexperiments,
  699.                void (*modelfunc)(fVector YModel, fVector XModel,
  700.                                  ui size, unsigned iexperiment),
  701.                void (*derivatives)(fVector dYdAi,fVector X, ui size,
  702.                                  unsigned ipar, unsigned iexperiment) );
  703.  
  704. void    VF_multiNonlinfit_autoDeriv( fVector dYdAi, fVector X, ui size,
  705.                                        unsigned iexperiment, unsigned ipar );
  706. void    MF_multiNonlinfit_autoDeriv(fMatrix dZdAi, unsigned htZ, unsigned lenZ,
  707.                                     fVector X, fVector Y,
  708.                                     unsigned ipar, unsigned iexperiment );
  709. void     MF_multiNonlinfit_getBestA( fVector ABest );
  710. void     VF_multiNonlinfit_getBestA( fVector ABest );
  711. float    MF_multiNonlinfit_getChi2( void );
  712. float    VF_multiNonlinfit_getChi2( void );
  713. int      MF_multiNonlinfit_getTestDir( void );
  714. int      VF_multiNonlinfit_getTestDir( void );
  715. unsigned MF_multiNonlinfit_getTestPar( void );
  716. unsigned VF_multiNonlinfit_getTestPar( void );
  717. unsigned MF_multiNonlinfit_getTestRun( void );
  718. unsigned VF_multiNonlinfit_getTestRun( void );
  719. void     MF_multiNonlinfit_stop( void );
  720. void     VF_multiNonlinfit_stop( void );
  721.  
  722. float   MF_multiNonlinfitwW( fVector A, fPMatrix Covar,
  723.                 iVector AStatus, unsigned npars,
  724.                 MF_EXPERIMENT  *ListOfExperiments, unsigned nexperiments,
  725.                 void (*modelfunc)(fMatrix MZModel, unsigned htZ, unsigned lenZ,
  726.                                   fVector X, fVector Y, unsigned iexperiment ),
  727.                 void (*derivatives)(fMatrix dZdAi, unsigned htZ, unsigned lenZ,
  728.                                     fVector X, fVector Y,
  729.                                     unsigned ipar, unsigned iexperiment) );
  730. float   VF_multiNonlinfitwW( fVector A, fPMatrix Covar,
  731.                 iVector AStatus, unsigned npars,
  732.                 VF_EXPERIMENT *ListOfExperiments, unsigned nexperiments,
  733.                 void (*modelfunc)(fVector YModel, fVector X, ui size,
  734.                                   unsigned iexperiment),
  735.                 void (*derivatives)(fVector dYdAi, fVector X, ui size,
  736.                                   unsigned ipar, unsigned iexperiment) );
  737. void    MF_multiNonlinfitwW_autoDeriv( fMatrix dZdAi,
  738.                                     unsigned htZ, unsigned lenZ,
  739.                                     fVector X, fVector Y,
  740.                                     unsigned ipar, unsigned iexperiment );
  741. void    VF_multiNonlinfitwW_autoDeriv( fVector dYdAi, fVector X, ui size,
  742.                                        unsigned iexperiment, unsigned ipar );
  743. void     MF_multiNonlinfitwW_getBestA( fVector ABest );
  744. void     VF_multiNonlinfitwW_getBestA( fVector ABest );
  745. float    MF_multiNonlinfitwW_getChi2( void );
  746. float    VF_multiNonlinfitwW_getChi2( void );
  747. int      MF_multiNonlinfitwW_getTestDir( void );
  748. int      VF_multiNonlinfitwW_getTestDir( void );
  749. unsigned MF_multiNonlinfitwW_getTestPar( void );
  750. unsigned VF_multiNonlinfitwW_getTestPar( void );
  751. unsigned MF_multiNonlinfitwW_getTestRun( void );
  752. unsigned VF_multiNonlinfitwW_getTestRun( void );
  753. void     MF_multiNonlinfitwW_stop( void );
  754. void     VF_multiNonlinfitwW_stop( void );
  755.  
  756.  
  757. void    M_nfree( unsigned n, ... );
  758. float   MF_nonlinfit( fVector A, iVector AStatus, unsigned npars,
  759.                     fVector X, fVector Y, fPMatrix MZ, unsigned htZ, unsigned lenZ,
  760.                     void (*modelfunc)(fMatrix MZModel, unsigned htZ, unsigned lenZ, fVector X, fVector Y ),
  761.                     void (*derivatives)(fMatrix dZdAi, unsigned htZ, unsigned lenZ, fVector X, fVector Y, unsigned ipar) );
  762.        /* returns figure-of-merit of best A. If you don't know the partial
  763.           derivatives with respect to A, call with derivatives=NULL */
  764. float   MF_nonlinfitwW( fVector A, fPMatrix Covar, iVector AStatus, unsigned npars,
  765.                     fVector X, fVector Y, fPMatrix MZ, fPMatrix MInvVar, unsigned htZ, unsigned lenZ,
  766.                     void (*modelfunc)(fMatrix MZModel, unsigned htZ, unsigned lenZ, fVector X, fVector Y ),
  767.                     void (*derivatives)(fMatrix dZdAi, unsigned htZ, unsigned lenZ, fVector X, fVector Y, unsigned ipar) );
  768. float   VF_nonlinfit( fVector A, iVector AStatus, unsigned npars,
  769.                       fVector X, fVector Y, ui sizex,
  770.                       void (*modelfunc)(fVector YModel, fVector XModel, ui size),
  771.                       void (*derivatives)(fVector dYdAi,fVector X, ui size, unsigned iPar) );
  772. float   VF_nonlinfitwW( fVector A, fPMatrix Covar, iVector AStatus, unsigned npars,
  773.                     fVector X, fVector Y, fVector InvVar, ui sizex,
  774.                     void (*modelfunc)(fVector YModel, fVector X, ui size),
  775.                     void (*derivatives)(fVector dYdAi, fVector X, ui size, unsigned i) );
  776. void    MF_outerprod( fMatrix MA, fVector X,  fVector Y,
  777.                       unsigned ht, unsigned len );
  778. void    MF_Parzen( fMatrix MA, unsigned ht, unsigned len );
  779. float * MF_Pelement( fMatrix X, unsigned ht, unsigned len,
  780.                      unsigned m, unsigned n );
  781. void    VF_polyfit( fVector A, unsigned deg, fVector X, fVector Y, ui sizex );
  782. void    VF_polyfitwW( fVector A, fPMatrix Covar, unsigned deg,
  783.                       fVector X, fVector Y, fVector InvVar, ui sizex );
  784. void    MF_read( fPMatrix X, unsigned ht, unsigned len, FILE  *stream );
  785. void    MF_recall( fMatrix MA, unsigned ht, unsigned len, FILE *stream);
  786. void    MF_Row_addC( fMatrix MA, unsigned ht, unsigned len,
  787.                          unsigned iRow, float C );
  788. void    MF_Row_addV( fMatrix MA, unsigned ht, unsigned len,
  789.                          unsigned iRow, fVector X );
  790. void    MF_Row_divC( fMatrix MA, unsigned ht, unsigned len,
  791.                          unsigned iRow, float C );
  792. void    MF_Row_divrC( fMatrix MA, unsigned ht, unsigned len,
  793.                          unsigned iRow, float C );
  794. void    MF_Row_divrV( fMatrix MA, unsigned ht, unsigned len,
  795.                          unsigned iRow, fVector X );
  796. void    MF_Row_divV( fMatrix MA, unsigned ht, unsigned len,
  797.                          unsigned iRow, fVector X );
  798. void    MF_Row_equC( fMatrix MA, unsigned ht, unsigned len,
  799.                      unsigned iRow, float C );
  800. void    MF_Row_equV( fMatrix MA, unsigned ht, unsigned len,
  801.                      unsigned iRow, fVector X );
  802. void    MF_Row_extract( fVector Y, fMatrix MA, unsigned ht, unsigned len,
  803.                         unsigned iRow );
  804. void    MF_Row_mulC( fMatrix MA, unsigned ht, unsigned len,
  805.                          unsigned iRow, float C );
  806. void    MF_Row_mulV( fMatrix MA, unsigned ht, unsigned len,
  807.                          unsigned iRow, fVector X );
  808. void    MF_Row_subC( fMatrix MA, unsigned ht, unsigned len,
  809.                          unsigned iRow, float C );
  810. void    MF_Row_subrC( fMatrix MA, unsigned ht, unsigned len,
  811.                          unsigned iRow, float C );
  812. void    MF_Row_subrV( fMatrix MA, unsigned ht, unsigned len,
  813.                          unsigned iRow, fVector X );
  814. void    MF_Row_subV( fMatrix MA, unsigned ht, unsigned len,
  815.                          unsigned iRow, fVector X );
  816. void    MF_Rows_absmax( fVector Y, fPMatrix MA, unsigned ht, unsigned len );
  817. void    MF_Rows_absmin( fVector Y, fPMatrix MA, unsigned ht, unsigned len );
  818. void    MF_Rows_add( fPMatrix MA, unsigned ht, unsigned len,
  819.                      unsigned destRow, unsigned sourceRow );
  820. void    MF_Rows_Cadd( fPMatrix MA, unsigned ht, unsigned len,
  821.                       unsigned destRow, unsigned sourceRow, float C );
  822. void    MF_Rows_exchange( fPMatrix MA, unsigned ht, unsigned len,
  823.                          unsigned i1, unsigned i2 );
  824. void    MF_Rows_lincomb( fPMatrix MA, unsigned ht, unsigned len,
  825.                          unsigned destRow,  float  destC,
  826.                          unsigned srceRow,  float  srceC );
  827. void    MF_Rows_max( fVector Y, fPMatrix MA, unsigned ht, unsigned len );
  828. void    MF_Rows_min( fVector Y, fPMatrix MA, unsigned ht, unsigned len );
  829. void    MF_Rows_prod(fVector Y, fPMatrix MA, unsigned ht, unsigned len );
  830. void    MF_Rows_reflect( fPMatrix MA, unsigned ht, unsigned len );
  831. void    MF_Rows_rotate( fPMatrix MA, unsigned ht, unsigned len, int pos );
  832. void    MF_Rows_runprod( fPMatrix MA, unsigned ht, unsigned len );
  833. void    MF_Rows_runsum( fPMatrix MA, unsigned ht, unsigned len );
  834. void    MF_Rows_sub( fPMatrix MA, unsigned ht, unsigned len,
  835.                      unsigned destRow, unsigned sourceRow );
  836. void    MF_Rows_sum( fVector Y, fPMatrix MA, unsigned ht, unsigned len );
  837. int     MF_safeSolve( fVector X, fPMatrix MA, fVector B, unsigned len );
  838.               /* ret.value 0: success via LUD; 1: success via SVD; -1: error */
  839.  
  840. void    M_setDensityMapBounds(  extended xmin, extended xmax,
  841.                                 extended ymin, extended ymax,
  842.                                 extended zmin, extended zmax,
  843.                                 COLORREF mincolor, COLORREF maxcolor );
  844. void    M_setDensityBounds(  extended zmin, extended zmax,
  845.                              COLORREF mincolor, COLORREF maxcolor );
  846.  
  847. void    VF_setLinfitNeglect( float Thresh );
  848.                 /* neglect A[i]=0, if significance smaller than Thresh */
  849. void    VF_setNonlinfitOptions( VF_NONLINFITOPTIONS *Options );
  850. void    MF_setWriteFormat( char *FormatString );
  851. void    MF_setWriteSeparate( char *SepString );
  852. int     MF_solve( fVector X, fPMatrix MA, fVector B, unsigned len );
  853. int     MF_solveBySVD( fVector X, fPMatrix MA, fVector B,
  854.                            unsigned htA, unsigned lenA );
  855.               /*  sizX = lenA,  sizB = htA.  ret.value != 0 signals failure */
  856. void    MF_spectrum( fPMatrix MSpec, unsigned htSpec, unsigned lenSpec,
  857.                      fPMatrix MX, unsigned htX, unsigned lenX,
  858.                      fPMatrix MWin );
  859.           /*   htSpec, lenSpec must be 2**n,
  860.                MSpec has [htSpec+1][lenSpec+1] elements (!)
  861.                htX >= n*htSpec,  lenX >= n*lenSpec,
  862.                htWin = 2*htSpec, lenWin = 2*lenSpec     */
  863.  
  864. void    MF_store( FILE *str, fMatrix MA, unsigned ht, unsigned len );
  865. void    MF_submatrix( fMatrix MSub,
  866.                       unsigned subHt,  unsigned subLen,
  867.                       fMatrix MSrce,
  868.                       unsigned srceHt,  unsigned srceLen,
  869.                       unsigned firstRowInCol,  unsigned sampInCol,
  870.                       unsigned firstColInRow,  unsigned sampInRow );
  871.  
  872. void    MF_submatrix_equM( fMatrix MDest,
  873.                            unsigned destHt,  unsigned destLen,
  874.                            unsigned firstRowInCol,  unsigned sampInCol,
  875.                            unsigned firstColInRow,  unsigned sampInRow,
  876.                            fMatrix MSrce,
  877.                            unsigned srceHt,  unsigned srceLen );
  878. int     MF_SVdecompose( fPMatrix MU, fPMatrix MV, fVector W, fPMatrix MA,
  879.                            unsigned htA, unsigned lenA );
  880. void    MF_SVDsetEdit( float Thresh );
  881. float   MF_SVDgetEdit( void ); /* Override of the standard values for editing
  882.                 threshholds in MF_SVsolve. Calling MF_setEdit with Thresh=0.0
  883.                 means that you do the necessary editing of W yourself before
  884.                 calling  MD_SVsolve                           */
  885. void    MF_SVimprove(  fVector X, fVector B, fPMatrix MA,
  886.                        fPMatrix MU, fPMatrix MV, fVector W,
  887.                        unsigned htA, unsigned lenA );
  888. void    MF_SVsolve( fVector X, fPMatrix MU, fPMatrix MV, fVector W,
  889.                        fVector B, unsigned htU, unsigned lenU );
  890. void    MF_transpose( fMatrix MTr, fPMatrix MA,
  891.                        unsigned htTr, unsigned lenTr );
  892. void    MF_UequL( fMatrix MA, unsigned len );
  893. void    MF_Welch( fMatrix MA, unsigned ht, unsigned len );
  894. void    MF_write( FILE  *stream, fPMatrix X, unsigned ht, unsigned len  );
  895. void    MF_xcorr( fPMatrix MXCorr, fPMatrix MX, fPMatrix MY,
  896.                      unsigned ht, unsigned len );
  897. void    MF_xyzAutoDensityMap( fVector X, fVector Y, fMatrix MZ,
  898.                               unsigned ht, unsigned len,
  899.                               COLORREF mincolor, COLORREF maxcolor );
  900. void    MF_xyzDataDensityMap( fVector X, fVector Y, fMatrix MZ,
  901.                               unsigned ht, unsigned len );
  902. void    MFzAutoDensityMap( fMatrix MZ, unsigned ht, unsigned len,
  903.                              COLORREF mincolor, COLORREF maxcolor );
  904. void    MFzDataDensityMap( fMatrix MZ, unsigned ht, unsigned len );
  905.  
  906.  
  907. ****************************************************************************
  908. *                                                                          *
  909. *******                      E  N  D                                 *******
  910. *                                                                          *
  911. ****************************************************************************
  912.  
  913. Copyright for OptiVec software and documentation
  914. (C) 1996-1998 Martin Sander.
  915. All rights reserved!
  916.